<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Serie_model extends CI_Model { 
    function __construct()
    {
        // Call the Model constructor
        parent::__construct();
    }
    
    function get_series()
    {
        $query = 
            "SELECT 
                serie.id,
                CONCAT(
                    make.name,
                    ' - ',
                    CAST(serie.year AS CHAR),
                    ' - ',
                    color.color) AS serie_label
            FROM 
                -- psacar_series AS serie
                INNER JOIN psacar_model AS model on serie.model_id = model.id
                INNER JOIN psacar_make as make on model.make_id = make.id
                INNER JOIN psacar_color as color on serie.color_id = color.id";
        
        $result = $this->db->query($query);
        return  $result;
    }   
}